<div [@routerTransition]>
  <div class="m-subheader">
    <div class="d-flex align-items-center">
      <div class="mr-auto col-xs-6">
        <h3 class="m-subheader__title m-subheader__title--separator">
          <span>对账单</span>
        </h3>
        <span class="m-section__sub">
          <!-- {{l("UsersHeaderInfo")}} -->
        </span>
      </div>
      <div class="col-xs-6 text-right">
        <form #logoUploadForm>
          <div class="form-group">
            <input type="file" ng2FileSelect [uploader]="excelUploader" class="col-lg-12 btn btn-outline-success"
              required />
            <!-- <button (click)="importExcel()" class="btn btn-primary"><i class="fa fa-plus"></i>下单</button> -->
            <!-- <span class="m-form__help col-lg-12">选择文件</span> -->
          </div>

          <!-- <button (click)="importExcel()" class="btn btn-primary"><i class="fa fa-plus"></i> 开始导入</button> -->
        </form>
        <!-- <button (click)="createUser()" *ngIf="isGranted('Pages.Administration.Users.Create')" class="btn btn-primary"><i
              class="fa fa-plus"></i> {{l("CreateNewUser")}}</button> -->
      </div>
    </div>
  </div>
  <div class="m-content">
    <div class="m-portlet m-portlet--mobile">
      <div class="m-portlet__body">
        <form class="horizontal-form" autocomplete="off">
          <div class="m-form m-form--label-align-right">
            <div class="row align-items-center m--margin-bottom-10">
              <div class="col-xl-12">
                <div class="form-group m-form__group align-items-center">
                  <div class="input-group">
                    <input [(ngModel)]="filterText" name="filterText" autoFocus class="form-control m-input"
                      [placeholder]="l('SearchWithThreeDot')" type="text">
                    <span class="input-group-btn">
                      <button (click)="getPageList()" class="btn btn-primary" type="submit"><i class="flaticon-search-1"
                          [attr.aria-label]="l('Search')"></i></button>
                    </span>
                  </div>
                </div>
              </div>
            </div>

            <div class="row margin-bottom-10" *ngIf="advancedFiltersAreShown">
              <div class="col-sm-12 text-right">
                <button class="btn btn-metal" (click)="getPageList()"><i class="fa fa-refresh"></i>
                  {{l("Refresh")}}</button>
              </div>
            </div>
            <div class="row margin-bottom-10">
              <div class="col-sm-12">
                <span class="clickable-item text-muted" *ngIf="!advancedFiltersAreShown" (click)="advancedFiltersAreShown=!advancedFiltersAreShown"><i
                    class="fa fa-angle-down"></i> {{l("ShowAdvancedFilters")}}</span>
                <span class="clickable-item text-muted" *ngIf="advancedFiltersAreShown" (click)="advancedFiltersAreShown=!advancedFiltersAreShown"><i
                    class="fa fa-angle-up"></i> {{l("HideAdvancedFilters")}}</span>
              </div>
            </div>
          </div>
        </form>

        <div class="row align-items-center">
          <!--<Primeng-TurboTable-Start>-->
          <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
            <p-table #dataTable (onLazyLoad)="getPageList($event)" [value]="primengTableHelper.records" rows="{{primengTableHelper.defaultRecordsCountPerPage}}"
              [paginator]="false" [lazy]="true" [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
              [resizableColumns]="primengTableHelper.resizableColumns">
              <ng-template pTemplate="header">
                <tr>
                  <th style="width: 130px" [hidden]="!isGrantedAny('Pages.Manager.WulingAddressLibrary')">{{l('Actions')}}</th>
                  <th style="width: 100px" pSortableColumn="serviceStationCode">
                    序号
                    <p-sortIcon field="id"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="date">
                    日期
                    <p-sortIcon field="date"></p-sortIcon>
                  </th>
                  <th style="width: 250px" pSortableColumn="waybillNumber">
                    运单号码
                    <p-sortIcon field="waybillNumber"></p-sortIcon>
                  </th>

                  <th style="width: 250px">
                    付款方式
                    <p-sortIcon field="addres.receiverAddress"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="fee">
                    费用(元)
                    <p-sortIcon field="fee"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="quantity">
                    折扣/促销
                    <p-sortIcon field="quantity"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="amountPayable">
                    应付金额
                    <p-sortIcon field="amountPayable"></p-sortIcon>
                  </th>
                  <th style="width: 120px" pSortableColumn="shippingNumber">
                    经手人
                    <p-sortIcon field="shippingNumber"></p-sortIcon>
                  </th>
                  <th style="width: 120px" pSortableColumn="consignmentContent">
                    托寄物内容
                    <p-sortIcon field="consignmentContent"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="expressProductType">
                    托寄物数量
                    <p-sortIcon field="expressProductType"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="paymentMethod">
                    声明价值
                    <p-sortIcon field="paymentMethod"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="monthlyCardNumber">
                    件数
                    <p-sortIcon field="monthlyCardNumber"></p-sortIcon>
                  </th>



                  <th style="width: 100px" pSortableColumn="whetherTheValuation">
                    签收人
                    <p-sortIcon field="whetherTheValuation"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="declaredValue">
                    签收时间
                    <p-sortIcon field="declaredValue"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="monthlyCardNumber">
                    结算日期
                    <p-sortIcon field="monthlyCardNumber"></p-sortIcon>
                  </th>



                  <th style="width: 135px" pSortableColumn="whetherTheValuation">
                    付款网点
                    <p-sortIcon field="whetherTheValuation"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="note1">
                    寄件网点
                    <p-sortIcon field="note1"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="note2">
                    派件网点
                    <p-sortIcon field="note2"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="note3">
                    备 注
                    <p-sortIcon field="note3"></p-sortIcon>
                  </th>
                  <th style="width: 100px" pSortableColumn="creationTime">
                    {{l('CreationTime')}}
                    <p-sortIcon field="creationTime"></p-sortIcon>
                  </th>
                </tr>
              </ng-template>
              <ng-template pTemplate="body" let-record="$implicit">
                <tr>
                  <td style="width: 130px" [hidden]="!isGrantedAny('Pages.Manager.WulingAddressLibrary')">
                    <div class="btn-group dropdown" dropdown container="body">
                      <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                        <i class="fa fa-cog"></i><span class="caret"></span> {{l("Actions")}}
                      </button>
                      <ul class="dropdown-menu" *dropdownMenu>
                        <!-- <li>
                          <a href="javascript:;" (click)="orderinfoModal.show(record.id)">查单</a>
                        </li><li>
                          <a href="javascript:;" (click)="printModal.show(record.id)">打单</a>
                        </li>
                        <li>
                          <a href="javascript:;" (click)="printModal.show(record.id)">{{l('Edit')}}</a>
                        </li> -->

                        <li>
                          <a href="javascript:;" (click)="delete(record)">{{l('Delete')}}</a>
                        </li>
                      </ul>
                    </div>
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('UserName')}}</span>
                    {{record.id}}
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('UserName')}}</span>
                    {{record.date}}
                  </td>
                  <td style="width: 250px">
                    <span class="ui-column-title"> {{l('Name')}}</span>
                    {{record.waybillNumber}}
                  </td>
                  <td style="width: 250px">
                    <span class="ui-column-title"> {{l('Surname')}}</span>
                    {{record.paymentMethod}}
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('Roles')}}</span>
                    {{record.fee}}
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('EmailAddress')}}</span>
                    {{record.discountOrPromotion}}
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('EmailConfirm')}}</span>
                    {{record.amountPayable}}
                    <!-- <span class="label label-success" *ngIf="record.isEmailConfirmed">{{l('Yes')}}</span>
                                            <span class="label label-default" *ngIf="!record.isEmailConfirmed">{{l('No')}}</span> -->
                  </td>
                  
                  <td style="width: 120px">
                    <span class="ui-column-title"> {{l('ShippingNumber')}}</span>
                    {{record.agent}}
                    <!-- <span class="label label-success" *ngIf="record.isEmailConfirmed">{{l('Yes')}}</span>
                                              <span class="label label-default" *ngIf="!record.isEmailConfirmed">{{l('No')}}</span> -->
                  </td>
                  <td style="width: 120px">
                    <span class="ui-column-title"> {{l('contentOfConsignment')}}</span>
                    {{record.consignmentContent}}
                    <!-- <span class="label label-success" *ngIf="record.isEmailConfirmed">{{l('Yes')}}</span>
                                              <span class="label label-default" *ngIf="!record.isEmailConfirmed">{{l('No')}}</span> -->
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('Active')}}</span>
                    {{record.consignmentQuantity}}
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('LastLoginTime')}}</span>
                    {{record.paymentMethod}}
                    <!-- <span *ngIf="record.lastLoginTime">{{record.lastLoginTime | momentFormat:'L'}}</span>
                                            <span *ngIf="!record.lastLoginTime">-</span> -->
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('note1')}}</span>
                    {{record.signatoryAndRecipient}}
                    <!-- {{record.creationTime | momentFormat:'L'}} -->
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('note1')}}</span>
                    {{record.signatoryAndRecipient}}
                    <!-- {{record.creationTime | momentFormat:'L'}} -->
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('note1')}}</span>
                    {{record.timeOfSigningAndReceiving}}
                    <!-- {{record.creationTime | momentFormat:'L'}} -->
                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('note1')}}</span>
                    {{record.settlementDate}}
                    <!-- {{record.creationTime | momentFormat:'L'}} -->
                  </td>
                  <td style="width: 130px">
                    <span class="ui-column-title"> {{l('note1')}}</span>
                    {{record.paymentNetwork}}

                  </td>

                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('note1')}}</span>
                    {{record.sendDeptCode}}

                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('note2')}}</span>
                    {{record.deliveryDeptCode}}

                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('notes')}}</span>
                    {{record.notes}}

                  </td>
                  <td style="width: 100px">
                    <span class="ui-column-title"> {{l('CreationTime')}}</span>
                    {{record.creationTime | momentFormat:'L'}}
                  </td>
                </tr>
              </ng-template>
            </p-table>
            <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
              {{l('NoData')}}
            </div>
            <div class="primeng-paging-container">
              <p-paginator rows="{{primengTableHelper.defaultRecordsCountPerPage}}" #paginator (onPageChange)="getPageList($event)"
                [totalRecords]="primengTableHelper.totalRecordsCount" [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
              </p-paginator>
              <span class="total-records-count">
                {{l('TotalRecordsCount', primengTableHelper.totalRecordsCount)}}
              </span>
            </div>
          </div>
          <!--<Primeng-TurboTable-End>-->
        </div>
      </div>
    </div>
  </div>
  <printModal #printModal></printModal>
  <orderinfoModal #orderinfoModal></orderinfoModal>

</div>